<?phpclass Factory{	function getDB($new=false){		global $__DB;		if($new || empty($__DB)){			$__DB = new mysqldb();		}		return $__DB;	}	function getApplication(){		global $__APP;		if(empty($__APP)){			$__APP = new Application();		}		return $__APP;	}		function getLog($phpFile, $level=LOG_LEVEL ,$logPath=LOG_DIR){		return new Logger($phpFile, $level, $logPath);	}		function getSession(){		global $__SESS;		if(empty($__SESS)){			$__SESS = new Session();		}		return $__SESS;	}		function getRequest(){		global $__REQ;		if(empty($__REQ)){			$__REQ = new Request();		}		return $__REQ;	}		function getUser(){		//TODO	}	}